home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Rexx / X-Tool.pprx < prev    next >
Text File  |  2000-05-08  |  2KB  |  71 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1996, 1997 Cloanto Italia srl */
  2.  
  3. /* $VER: XTool.pprx 1.0 */
  4.  
  5. /** ENG
  6.  This is a example of a "tool script". This tool, entirely created in
  7.  Rexx, draws an "X" on the image, using the current brush, foreground
  8.  color and paint mode.
  9. */
  10.  
  11. /** DEU
  12.  Dies ist ein Beispiel für ein "Tool Skript". Dieses ausschließlich
  13.  in Rexx geschriebene Tool zeichnet ein "X" auf das Bild, wobei die
  14.  aktuellen Einstellungen für Brush, Vordergrundfarbe und Malmodus
  15.  verwendet werden.
  16. */
  17.  
  18. /** ITA
  19.  Questo è un esempio di "strumento realizzato tramite script". Questo
  20.  strumento, scritto totalmente in Rexx, traccia una "X" sull'immagine,
  21.  usando il pennello, il colore di primo piano e il modo di disegno attuali.
  22. */
  23.  
  24. IF ARG(1, EXISTS) THEN
  25.     PARSE ARG PPPORT button x0 y0 .
  26. ELSE
  27.     EXIT 0  /* macro execution only */
  28.  
  29. ADDRESS VALUE PPPORT
  30. OPTIONS RESULTS
  31. OPTIONS FAILAT 10000
  32.  
  33. Get 'LANG'
  34. IF RESULT = 1 THEN DO        /* Deutsch */
  35.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  36. END
  37. ELSE IF RESULT = 2 THEN        /* Italiano */
  38.     txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  39. ELSE                /* English */
  40.     txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
  41.  
  42. Version 'REXX'
  43. IF RESULT < 7 THEN DO
  44.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  45.     EXIT 10
  46. END
  47.  
  48. prev_xp = x0
  49. prev_yp = y0
  50. drawn = 0
  51.  
  52. DO FOREVER
  53.     GetMousePosition
  54.     PARSE VAR RESULT xp yp .
  55.  
  56.     IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  57.         IF drawn THEN
  58.             Undo 2
  59.         DrawLine x0 y0 xp yp
  60.         DrawLine xp y0 x0 yp
  61.         prev_xp = xp
  62.         prev_yp = yp
  63.         drawn = 1
  64.     END
  65.     ELSE WaitForEvent
  66.  
  67.     GetMouseButton
  68.     IF RESULT ~= button THEN
  69.         LEAVE
  70. END
  71.